<?php	
function arr2js($arrays){
	if (is_array($arrays)){
		$json = "{";
		$mark=1;
		foreach ($arrays as $key=>$value){
			if ($mark) {
				$json .= "'$key':";
				$mark = 0;
			} else {
				$json .= ",'$key':";
			}
			if (is_array($value)){
				$data = arr2js($value);
				$json .= "$data";
			} else {
				$data = $value;
				$json .= "'$data'";
			}
		}
		$json .= "}";
	} else {
		$json = $arrays;
	}
	return $json;
}
?>